package service;


import dao.UserDao;
import org.springframework.stereotype.Service;
import pojo.User;

@Service("userService")
public class UserServiceImpl implements UserService{
    //只声明接口类型引用
    private UserDao dao;
    //无参构造
    public UserServiceImpl(){

    }
    public UserServiceImpl(UserDao userDao){
        this.dao = userDao;
    }

    /**
     * 保存用户
     */
    public void save(User user){
        //保存用户信息
        dao.saveUser(user);
    }

    public UserDao getDao() {
        return dao;
    }

    public void setDao(UserDao dao) {
        this.dao = dao;
    }
}
